import React from 'react';
import {Layout} from 'antd';
import {name, copyright, website} from '../../config/config';
import classNames from 'classnames';
import styles from './CFooter.less';

const {Footer} = Layout;

export default ({className, links}) => {
  const clsString = classNames(styles.globalFooter, className);
  return (
    <Footer className={clsString}>
      {
        links && (
          <div className={styles.links}>
            {links.map(item => (
              <a
                key={item.title}
                target={item.blankTarget ? '_blank' : '_self'}
                href={item.href}
              >
                {item.title}
              </a>
            ))}
          </div>
        )
      }
      <div className={styles.copyright}>{copyright}&nbsp;<a href={`${website}`}>{name}</a></div>
    </Footer>
  );
};
